<?php 
if ( ! defined('BASEPATH')) exit('No direct script access allowed');


    function send_email($params) 
	{
		$CI =& get_instance();
		
		$config['mailtype'] = 'html';
		$CI->email->initialize($config);
		
		$msg = $CI->load->view($params['view'], $params['data'], TRUE);

		$CI->email->from($params['from'], $params['name']);
		$CI->email->to($params["to"]); 
		$CI->email->bcc('mariomunera89@gmail.com');  
		
		$CI->email->subject($params['subject']);
		$CI->email->message($msg);	
		
		$CI->email->send();
		
		echo $CI->email->print_debugger();
	}
	
?>